

<!doctype html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>skidl.geometry module &#8212; SKiDL 2.2.0 documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/bizstyle.css?v=a66e137f" />
    
    <script src="../_static/documentation_options.js?v=b21de401"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/bizstyle.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <!--[if lt IE 9]>
    <script src="_static/css3-mediaqueries.js"></script>
    <![endif]-->
  </head><body>
    <h1 id="site-title"><a href="../../../"><img src="../../../images/slim_banner.png" width="100%"></a></h1>
    
    <div class="related" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 2.2.0 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.geometry module</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="module-skidl.geometry">
<span id="skidl-geometry-module"></span><h1>skidl.geometry module<a class="headerlink" href="#module-skidl.geometry" title="Link to this heading">¶</a></h1>
<p>Geometric primitives and transformations for SKiDL.</p>
<p>This module provides classes and functions to handle geometric operations needed for
positioning and transforming components. It includes support for
points/vectors, transformation matrices, and unit conversions between millimeters
and thousandths-of-inch (mils).</p>
<dl class="py class">
<dt class="sig sig-object py" id="skidl.geometry.BBox">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">BBox</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">pts</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.13/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A bounding box defined by minimum and maximum points.</p>
<p>BBox represents a rectangular area that can contain points or other bounding boxes.
It provides methods for combining bounding boxes, testing if points are inside,
and calculating intersections.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>*pts</strong> – One or more Point objects defining the initial bounding box.</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.add">
<span class="sig-name descname"><span class="pre">add</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">objs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.add"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.add" title="Link to this definition">¶</a></dt>
<dd><p>Update the bounding box to include multiple points and/or bounding boxes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>*objs</strong> – Points or BBoxes to include in this bounding box.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The updated bounding box (self).</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox">BBox</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.area">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">area</span></span><a class="headerlink" href="#skidl.geometry.BBox.area" title="Link to this definition">¶</a></dt>
<dd><p>Calculate the area of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Area (width × height).</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.ctr">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ctr</span></span><a class="headerlink" href="#skidl.geometry.BBox.ctr" title="Link to this definition">¶</a></dt>
<dd><p>Get the center point of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Center point.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.h">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">h</span></span><a class="headerlink" href="#skidl.geometry.BBox.h" title="Link to this definition">¶</a></dt>
<dd><p>Get the height of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Height of the bounding box.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.intersection">
<span class="sig-name descname"><span class="pre">intersection</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bbox</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.intersection"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.intersection" title="Link to this definition">¶</a></dt>
<dd><p>Calculate the intersection of this bounding box with another.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>bbox</strong> (<a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox"><em>BBox</em></a>) – Another bounding box.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p><dl class="simple">
<dt>A new bounding box representing the intersection,</dt><dd><p>or None if there is no intersection.</p>
</dd>
</dl>
</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox">BBox</a> or None</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.intersects">
<span class="sig-name descname"><span class="pre">intersects</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">bbox</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.intersects"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.intersects" title="Link to this definition">¶</a></dt>
<dd><p>Check if this bounding box intersects with another.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>bbox</strong> (<a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox"><em>BBox</em></a>) – Another bounding box to check for intersection.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the bounding boxes intersect.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#bool" title="(in Python v3.13)">bool</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.is_inside">
<span class="sig-name descname"><span class="pre">is_inside</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pt</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.is_inside"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.is_inside" title="Link to this definition">¶</a></dt>
<dd><p>Check if a point is inside or on the boundary of this bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pt</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – The point to check.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if the point is inside or on the boundary.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#bool" title="(in Python v3.13)">bool</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.ll">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ll</span></span><a class="headerlink" href="#skidl.geometry.BBox.ll" title="Link to this definition">¶</a></dt>
<dd><p>Get the lower-left corner of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Lower-left corner point.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.lr">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">lr</span></span><a class="headerlink" href="#skidl.geometry.BBox.lr" title="Link to this definition">¶</a></dt>
<dd><p>Get the lower-right corner of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Lower-right corner point.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.resize">
<span class="sig-name descname"><span class="pre">resize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vector</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.resize"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.resize" title="Link to this definition">¶</a></dt>
<dd><p>Expand or contract the bounding box by a given amount in all directions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vector</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – Amount to expand by (positive values) or contract by
(negative values) in x and y directions.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A new resized bounding box.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox">BBox</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.round">
<span class="sig-name descname"><span class="pre">round</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.round"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.round" title="Link to this definition">¶</a></dt>
<dd><p>Round the bounding box limits to integers.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new bounding box with rounded coordinates.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox">BBox</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.BBox.snap_resize">
<span class="sig-name descname"><span class="pre">snap_resize</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">grid_spacing</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#BBox.snap_resize"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.BBox.snap_resize" title="Link to this definition">¶</a></dt>
<dd><p>Resize the bounding box to align min and max points to a grid.</p>
<p>This expands the bounding box outward so that its corners align with
the given grid spacing.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>grid_spacing</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – Grid spacing to align to.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A new bounding box with grid-aligned corners.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.BBox" title="skidl.geometry.BBox">BBox</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.ul">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ul</span></span><a class="headerlink" href="#skidl.geometry.BBox.ul" title="Link to this definition">¶</a></dt>
<dd><p>Get the upper-left corner of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Upper-left corner point.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.ur">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">ur</span></span><a class="headerlink" href="#skidl.geometry.BBox.ur" title="Link to this definition">¶</a></dt>
<dd><p>Get the upper-right corner of the bounding box.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Upper-right corner point.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.BBox.w">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">w</span></span><a class="headerlink" href="#skidl.geometry.BBox.w" title="Link to this definition">¶</a></dt>
<dd><p>Return the bounding box width.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="skidl.geometry.Point">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">Point</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.13/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A 2D point or vector with x and y coordinates.</p>
<p>The Point class represents both points in space and vectors for
geometric operations. It supports various arithmetic operations
and can be transformed using the Tx transformation matrix.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – The x-coordinate.</p></li>
<li><p><strong>y</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – The y-coordinate.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.flip_xy">
<span class="sig-name descname"><span class="pre">flip_xy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.flip_xy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.flip_xy" title="Link to this definition">¶</a></dt>
<dd><p>Swap the x and y coordinates in place.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.Point.magnitude">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">magnitude</span></span><a class="headerlink" href="#skidl.geometry.Point.magnitude" title="Link to this definition">¶</a></dt>
<dd><p>Calculate the distance of the point from origin (vector length).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>The Euclidean distance from origin.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.mask">
<span class="sig-name descname"><span class="pre">mask</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">msk</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.mask"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.mask" title="Link to this definition">¶</a></dt>
<dd><p>Apply a binary mask to the coordinates.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>msk</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/stdtypes.html#list" title="(in Python v3.13)"><em>list</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3.13/library/stdtypes.html#tuple" title="(in Python v3.13)"><em>tuple</em></a>) – A pair of values to multiply with x and y.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>New point with masked coordinates.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.max">
<span class="sig-name descname"><span class="pre">max</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pt</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.max"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.max" title="Link to this definition">¶</a></dt>
<dd><p>Create a new point using the maximum x and y from two points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pt</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – Another point to compare with.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>New point with maximum x and y values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.min">
<span class="sig-name descname"><span class="pre">min</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pt</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.min"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.min" title="Link to this definition">¶</a></dt>
<dd><p>Create a new point using the minimum x and y from two points.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pt</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – Another point to compare with.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>New point with minimum x and y values.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.Point.norm">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">norm</span></span><a class="headerlink" href="#skidl.geometry.Point.norm" title="Link to this definition">¶</a></dt>
<dd><p>Calculate a unit vector in the same direction.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Normalized vector with length 1, or (0,0) if zero length.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.round">
<span class="sig-name descname"><span class="pre">round</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.round"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.round" title="Link to this definition">¶</a></dt>
<dd><p>Round coordinates to nearest integers.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>New point with rounded coordinates.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.snap">
<span class="sig-name descname"><span class="pre">snap</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">grid_spacing</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.snap"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.snap" title="Link to this definition">¶</a></dt>
<dd><p>Snap point coordinates to a grid.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>grid_spacing</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – Grid interval to snap to.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>New point with coordinates snapped to the grid.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Point.xprod">
<span class="sig-name descname"><span class="pre">xprod</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pt</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Point.xprod"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Point.xprod" title="Link to this definition">¶</a></dt>
<dd><p>Calculate the cross product of this vector and another.</p>
<p>For 2D vectors, the cross product returns a scalar representing
the z-component of the 3D cross product.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>pt</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – Another point/vector.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>The cross product value.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="skidl.geometry.Segment">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">Segment</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">p1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Segment"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Segment" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.13/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A line segment between two points.</p>
<p>Represents a straight line segment with endpoints p1 and p2.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p1</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – First endpoint.</p></li>
<li><p><strong>p2</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – Second endpoint.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Segment.flip_xy">
<span class="sig-name descname"><span class="pre">flip_xy</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Segment.flip_xy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Segment.flip_xy" title="Link to this definition">¶</a></dt>
<dd><p>Swap the x and y coordinates of both endpoints.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Segment.intersects">
<span class="sig-name descname"><span class="pre">intersects</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Segment.intersects"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Segment.intersects" title="Link to this definition">¶</a></dt>
<dd><p>Check if this segment intersects with another segment.</p>
<p>Note: This method is not fully implemented and will raise an error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>other</strong> (<a class="reference internal" href="#skidl.geometry.Segment" title="skidl.geometry.Segment"><em>Segment</em></a>) – Another segment to check for intersection.</p>
</dd>
<dt class="field-even">Raises<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.13/library/exceptions.html#NotImplementedError" title="(in Python v3.13)"><strong>NotImplementedError</strong></a> – This method is not fully implemented.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Segment.round">
<span class="sig-name descname"><span class="pre">round</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Segment.round"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Segment.round" title="Link to this definition">¶</a></dt>
<dd><p>Round the segment endpoints to integers.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new segment with rounded endpoint coordinates.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Segment" title="skidl.geometry.Segment">Segment</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Segment.shadows">
<span class="sig-name descname"><span class="pre">shadows</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Segment.shadows"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Segment.shadows" title="Link to this definition">¶</a></dt>
<dd><p>Check if two segments overlap when projected onto axes.</p>
<p>This tests if the segments would overlap when viewed from above or the side,
even if they don’t physically intersect.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>other</strong> (<a class="reference internal" href="#skidl.geometry.Segment" title="skidl.geometry.Segment"><em>Segment</em></a>) – Another segment to check.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>True if segments shadow (overlap) each other on x or y axis.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#bool" title="(in Python v3.13)">bool</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="skidl.geometry.Tx">
<em class="property"><span class="k"><span class="pre">class</span></span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">Tx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">d</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dx</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx" title="Link to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3.13/library/functions.html#object" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A 2D transformation matrix for geometric operations.</p>
<p>This class implements a 3x3 transformation matrix for 2D operations
like rotation, scaling, flipping, and translation. The matrix has
the following structure:</p>
<p>[ a  b  0 ]
[ c  d  0 ]
[ dx dy 1 ]</p>
<p>Where the transformed coordinates are calculated as:
x’ = a*x + c*y + dx
y’ = b*x + d*y + dy</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>a</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Scaling/rotation factor for x coordinate. Defaults to 1.</p></li>
<li><p><strong>b</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Rotation factor for y contribution to x. Defaults to 0.</p></li>
<li><p><strong>c</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Rotation factor for x contribution to y. Defaults to 0.</p></li>
<li><p><strong>d</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Scaling/rotation factor for y coordinate. Defaults to 1.</p></li>
<li><p><strong>dx</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Translation in x direction. Defaults to 0.</p></li>
<li><p><strong>dy</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a><em>, </em><em>optional</em>) – Translation in y direction. Defaults to 0.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.flip_x">
<span class="sig-name descname"><span class="pre">flip_x</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.flip_x"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.flip_x" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with a horizontal flip (mirror across y-axis).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new transformation matrix with the flip applied.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.flip_y">
<span class="sig-name descname"><span class="pre">flip_y</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.flip_y"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.flip_y" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with a vertical flip (mirror across x-axis).</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new transformation matrix with the flip applied.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.from_symtx">
<em class="property"><span class="k"><span class="pre">classmethod</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">from_symtx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">symtx</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.from_symtx"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.from_symtx" title="Link to this definition">¶</a></dt>
<dd><p>Create a transformation matrix from a string of symbolic operations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>symtx</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/stdtypes.html#str" title="(in Python v3.13)"><em>str</em></a>) – A string of H, V, L, R operations that are applied in sequence left-to-right.
H = horizontal flip, V = vertical flip,
L = rotate 90° left (CCW), R = rotate 90° right (CW)</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A transformation matrix that implements the sequence of operations.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">tx</span> <span class="o">=</span> <span class="n">Tx</span><span class="o">.</span><span class="n">from_symtx</span><span class="p">(</span><span class="s2">&quot;RH&quot;</span><span class="p">)</span>  <span class="c1"># Rotate right, then flip horizontally</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.move">
<span class="sig-name descname"><span class="pre">move</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">vec</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.move"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.move" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with an additional translation applied.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>vec</strong> (<a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><em>Point</em></a>) – The vector to translate by.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A new transformation matrix with the translation applied.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.no_translate">
<span class="sig-name descname"><span class="pre">no_translate</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.no_translate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.no_translate" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with the same rotation/scaling but no translation.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new transformation matrix with translation set to (0,0).</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.Tx.origin">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">origin</span></span><a class="headerlink" href="#skidl.geometry.Tx.origin" title="Link to this definition">¶</a></dt>
<dd><p>Get the translation component of the transformation.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A Point object representing the (dx, dy) translation.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point">Point</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.rot">
<span class="sig-name descname"><span class="pre">rot</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">degs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.rot"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.rot" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with a rotation by the given angle in degrees.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>degs</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – The rotation angle in degrees.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A new transformation matrix with the rotation applied.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="skidl.geometry.Tx.rot_90cw">
<span class="sig-name descname"><span class="pre">rot_90cw</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#Tx.rot_90cw"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.Tx.rot_90cw" title="Link to this definition">¶</a></dt>
<dd><p>Return a new Tx with a 90-degree clockwise rotation applied.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A new transformation matrix with the rotation applied.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#skidl.geometry.Tx" title="skidl.geometry.Tx">Tx</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="skidl.geometry.Tx.scale">
<em class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">scale</span></span><a class="headerlink" href="#skidl.geometry.Tx.scale" title="Link to this definition">¶</a></dt>
<dd><p>Get the scaling factor of the transformation.</p>
<p>This calculates the length of a unit vector after transformation.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>The scaling factor.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="skidl.geometry.Vector">
<span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">Vector</span></span><a class="headerlink" href="#skidl.geometry.Vector" title="Link to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#skidl.geometry.Point" title="skidl.geometry.Point"><code class="xref py py-class docutils literal notranslate"><span class="pre">Point</span></code></a></p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.geometry.to_mils">
<span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">to_mils</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mm</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#to_mils"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.to_mils" title="Link to this definition">¶</a></dt>
<dd><p>Convert millimeters to thousandths-of-inch (mils).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>mm</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – Value in millimeters.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Equivalent value in mils.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="skidl.geometry.to_mms">
<span class="sig-prename descclassname"><span class="pre">skidl.geometry.</span></span><span class="sig-name descname"><span class="pre">to_mms</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">mils</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/skidl/geometry.html#to_mms"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#skidl.geometry.to_mms" title="Link to this definition">¶</a></dt>
<dd><p>Convert thousandths-of-inch (mils) to millimeters.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>mils</strong> (<a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)"><em>float</em></a>) – Value in mils.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Equivalent value in millimeters.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3.13/library/functions.html#float" title="(in Python v3.13)">float</a></p>
</dd>
</dl>
</dd></dl>

</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3><a href="../index.html">Table of Contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">skidl.geometry module</a><ul>
<li><a class="reference internal" href="#skidl.geometry.BBox"><code class="docutils literal notranslate"><span class="pre">BBox</span></code></a><ul>
<li><a class="reference internal" href="#skidl.geometry.BBox.add"><code class="docutils literal notranslate"><span class="pre">BBox.add()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.area"><code class="docutils literal notranslate"><span class="pre">BBox.area</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.ctr"><code class="docutils literal notranslate"><span class="pre">BBox.ctr</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.h"><code class="docutils literal notranslate"><span class="pre">BBox.h</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.intersection"><code class="docutils literal notranslate"><span class="pre">BBox.intersection()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.intersects"><code class="docutils literal notranslate"><span class="pre">BBox.intersects()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.is_inside"><code class="docutils literal notranslate"><span class="pre">BBox.is_inside()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.ll"><code class="docutils literal notranslate"><span class="pre">BBox.ll</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.lr"><code class="docutils literal notranslate"><span class="pre">BBox.lr</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.resize"><code class="docutils literal notranslate"><span class="pre">BBox.resize()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.round"><code class="docutils literal notranslate"><span class="pre">BBox.round()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.snap_resize"><code class="docutils literal notranslate"><span class="pre">BBox.snap_resize()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.ul"><code class="docutils literal notranslate"><span class="pre">BBox.ul</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.ur"><code class="docutils literal notranslate"><span class="pre">BBox.ur</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.BBox.w"><code class="docutils literal notranslate"><span class="pre">BBox.w</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#skidl.geometry.Point"><code class="docutils literal notranslate"><span class="pre">Point</span></code></a><ul>
<li><a class="reference internal" href="#skidl.geometry.Point.flip_xy"><code class="docutils literal notranslate"><span class="pre">Point.flip_xy()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.magnitude"><code class="docutils literal notranslate"><span class="pre">Point.magnitude</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.mask"><code class="docutils literal notranslate"><span class="pre">Point.mask()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.max"><code class="docutils literal notranslate"><span class="pre">Point.max()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.min"><code class="docutils literal notranslate"><span class="pre">Point.min()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.norm"><code class="docutils literal notranslate"><span class="pre">Point.norm</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.round"><code class="docutils literal notranslate"><span class="pre">Point.round()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.snap"><code class="docutils literal notranslate"><span class="pre">Point.snap()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Point.xprod"><code class="docutils literal notranslate"><span class="pre">Point.xprod()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#skidl.geometry.Segment"><code class="docutils literal notranslate"><span class="pre">Segment</span></code></a><ul>
<li><a class="reference internal" href="#skidl.geometry.Segment.flip_xy"><code class="docutils literal notranslate"><span class="pre">Segment.flip_xy()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Segment.intersects"><code class="docutils literal notranslate"><span class="pre">Segment.intersects()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Segment.round"><code class="docutils literal notranslate"><span class="pre">Segment.round()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Segment.shadows"><code class="docutils literal notranslate"><span class="pre">Segment.shadows()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#skidl.geometry.Tx"><code class="docutils literal notranslate"><span class="pre">Tx</span></code></a><ul>
<li><a class="reference internal" href="#skidl.geometry.Tx.flip_x"><code class="docutils literal notranslate"><span class="pre">Tx.flip_x()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.flip_y"><code class="docutils literal notranslate"><span class="pre">Tx.flip_y()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.from_symtx"><code class="docutils literal notranslate"><span class="pre">Tx.from_symtx()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.move"><code class="docutils literal notranslate"><span class="pre">Tx.move()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.no_translate"><code class="docutils literal notranslate"><span class="pre">Tx.no_translate()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.origin"><code class="docutils literal notranslate"><span class="pre">Tx.origin</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.rot"><code class="docutils literal notranslate"><span class="pre">Tx.rot()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.rot_90cw"><code class="docutils literal notranslate"><span class="pre">Tx.rot_90cw()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.Tx.scale"><code class="docutils literal notranslate"><span class="pre">Tx.scale</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#skidl.geometry.Vector"><code class="docutils literal notranslate"><span class="pre">Vector</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.to_mils"><code class="docutils literal notranslate"><span class="pre">to_mils()</span></code></a></li>
<li><a class="reference internal" href="#skidl.geometry.to_mms"><code class="docutils literal notranslate"><span class="pre">to_mms()</span></code></a></li>
</ul>
</li>
</ul>

  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/rst_output/skidl.geometry.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">SKiDL 2.2.0 documentation</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">skidl.geometry module</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
    &#169; Copyright 2016-2025, Dave Vandenbout.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.2.3.
    </div>
  </body>
</html>